\(\int \sec ^4(e+f x) (a+b \sec ^2(e+f x)) \, dx\) [159]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 65 \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(5 a+4 b) \tan (e+f x)}{5 f}+\frac {b \sec ^4(e+f x) \tan (e+f x)}{5 f}+\frac {(5 a+4 b) \tan ^3(e+f x)}{15 f} \]

[Out]

1/5*(5*a+4*b)*tan(f*x+e)/f+1/5*b*sec(f*x+e)^4*tan(f*x+e)/f+1/15*(5*a+4*b)*tan(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4131, 3852} \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(5 a+4 b) \tan ^3(e+f x)}{15 f}+\frac {(5 a+4 b) \tan (e+f x)}{5 f}+\frac {b \tan (e+f x) \sec ^4(e+f x)}{5 f} \]

[In]

Int[Sec[e + f*x]^4*(a + b*Sec[e + f*x]^2),x]

[Out]

((5*a + 4*b)*Tan[e + f*x])/(5*f) + (b*Sec[e + f*x]^4*Tan[e + f*x])/(5*f) + ((5*a + 4*b)*Tan[e + f*x]^3)/(15*f)

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 4131

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(-C)*Cot
[e + f*x]*((b*Csc[e + f*x])^m/(f*(m + 1))), x] + Dist[(C*m + A*(m + 1))/(m + 1), Int[(b*Csc[e + f*x])^m, x], x
] /; FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {b \sec ^4(e+f x) \tan (e+f x)}{5 f}+\frac {1}{5} (5 a+4 b) \int \sec ^4(e+f x) \, dx \\ & = \frac {b \sec ^4(e+f x) \tan (e+f x)}{5 f}-\frac {(5 a+4 b) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (e+f x)\right )}{5 f} \\ & = \frac {(5 a+4 b) \tan (e+f x)}{5 f}+\frac {b \sec ^4(e+f x) \tan (e+f x)}{5 f}+\frac {(5 a+4 b) \tan ^3(e+f x)}{15 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.94 \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {a \left (\tan (e+f x)+\frac {1}{3} \tan ^3(e+f x)\right )}{f}+\frac {b \left (\tan (e+f x)+\frac {2}{3} \tan ^3(e+f x)+\frac {1}{5} \tan ^5(e+f x)\right )}{f} \]

[In]

Integrate[Sec[e + f*x]^4*(a + b*Sec[e + f*x]^2),x]

[Out]

(a*(Tan[e + f*x] + Tan[e + f*x]^3/3))/f + (b*(Tan[e + f*x] + (2*Tan[e + f*x]^3)/3 + Tan[e + f*x]^5/5))/f

Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {-a \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-b \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )}{f}\) \(58\)
default \(\frac {-a \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-b \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )}{f}\) \(58\)
parts \(-\frac {a \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}-\frac {b \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )}{f}\) \(60\)
parallelrisch \(\frac {\left (50 a +40 b \right ) \sin \left (3 f x +3 e \right )+\left (10 a +8 b \right ) \sin \left (5 f x +5 e \right )+40 \sin \left (f x +e \right ) \left (a +2 b \right )}{15 f \left (\cos \left (5 f x +5 e \right )+5 \cos \left (3 f x +3 e \right )+10 \cos \left (f x +e \right )\right )}\) \(85\)
risch \(\frac {4 i \left (15 a \,{\mathrm e}^{6 i \left (f x +e \right )}+35 a \,{\mathrm e}^{4 i \left (f x +e \right )}+40 b \,{\mathrm e}^{4 i \left (f x +e \right )}+25 a \,{\mathrm e}^{2 i \left (f x +e \right )}+20 b \,{\mathrm e}^{2 i \left (f x +e \right )}+5 a +4 b \right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{5}}\) \(87\)
norman \(\frac {-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{f}+\frac {8 \left (2 a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}+\frac {8 \left (2 a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{3 f}-\frac {4 \left (25 a +29 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{15 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{5}}\) \(119\)

[In]

int(sec(f*x+e)^4*(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(-a*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)-b*(-8/15-1/5*sec(f*x+e)^4-4/15*sec(f*x+e)^2)*tan(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.86 \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {{\left (2 \, {\left (5 \, a + 4 \, b\right )} \cos \left (f x + e\right )^{4} + {\left (5 \, a + 4 \, b\right )} \cos \left (f x + e\right )^{2} + 3 \, b\right )} \sin \left (f x + e\right )}{15 \, f \cos \left (f x + e\right )^{5}} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

1/15*(2*(5*a + 4*b)*cos(f*x + e)^4 + (5*a + 4*b)*cos(f*x + e)^2 + 3*b)*sin(f*x + e)/(f*cos(f*x + e)^5)

Sympy [F]

\[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \sec ^{4}{\left (e + f x \right )}\, dx \]

[In]

integrate(sec(f*x+e)**4*(a+b*sec(f*x+e)**2),x)

[Out]

Integral((a + b*sec(e + f*x)**2)*sec(e + f*x)**4, x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.66 \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {3 \, b \tan \left (f x + e\right )^{5} + 5 \, {\left (a + 2 \, b\right )} \tan \left (f x + e\right )^{3} + 15 \, {\left (a + b\right )} \tan \left (f x + e\right )}{15 \, f} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/15*(3*b*tan(f*x + e)^5 + 5*(a + 2*b)*tan(f*x + e)^3 + 15*(a + b)*tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.88 \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {3 \, b \tan \left (f x + e\right )^{5} + 5 \, a \tan \left (f x + e\right )^{3} + 10 \, b \tan \left (f x + e\right )^{3} + 15 \, a \tan \left (f x + e\right ) + 15 \, b \tan \left (f x + e\right )}{15 \, f} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

1/15*(3*b*tan(f*x + e)^5 + 5*a*tan(f*x + e)^3 + 10*b*tan(f*x + e)^3 + 15*a*tan(f*x + e) + 15*b*tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 18.42 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.65 \[ \int \sec ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {\frac {b\,{\mathrm {tan}\left (e+f\,x\right )}^5}{5}+\left (\frac {a}{3}+\frac {2\,b}{3}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (a+b\right )\,\mathrm {tan}\left (e+f\,x\right )}{f} \]

[In]

int((a + b/cos(e + f*x)^2)/cos(e + f*x)^4,x)

[Out]

(tan(e + f*x)^3*(a/3 + (2*b)/3) + (b*tan(e + f*x)^5)/5 + tan(e + f*x)*(a + b))/f